﻿///*********************************************************************
// *
// *                             NOTICE
// *               COPYRIGHT (c) 2012 Panoscopix Software, Inc.
// *                UNPUBLISHED - ALL RIGHTS RESERVED
// * 
// *      This program is confidential, proprietary, and a trade
// *   secret of Panoscopix Software, Inc. The receipt or possession of
// *     this program does not convey any rights to reproduce or
// *      disclose its contents, or to manufacture, use, or sell
// *       anything that it may describe, in whole or in part, 
// *   without the specific written consent of Panoscopix Software, Inc.
// *
// * Command class for "touching" a file, i.e., creating a file.
// * 
// *******************************************************************/
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;

//using FileSystem;
//using FileSystem.Utility;

//namespace FileSystem.Impl.Commands
//{
//    class Undo : IAction, IActionPrototype
//    {
//        public IHelpDescription Description
//        {
//            get;
//            private set;
//        }
//        private static void loadEmulator()
//        {
//            var zombie = new Undo(new HelpDescription() { Name = "undo", Description = "Undoes last command." });
//            IActionPrototypeRegistry r = AppResources.getInstance().getActionRegistry();
//            r.register("undo", zombie);
//        }

//        private Undo(IHelpDescription helpDescription)
//        {
//            //for zombie
//            this.Description = helpDescription;
//        }

//        #region IAction Members

//        public IResult execute()
//        {
            
//            IResult result;
//            if (!AppResources.getInstance().getManager().done().isEmpty())
//            {
//                var lastCommand = AppResources.getInstance().getManager().done().pop();
//                lastCommand.undo();

//                AppResources.getInstance().getManager().undone().push(lastCommand);

//                result = new Result(string.Format("Undo successfull - {0}", lastCommand.describe(new PrintContextImpl())));
//            }
//            else
//            {
//                result = new Result(true, "Nothing to undo");
//            }
//            return result;

//        }

//        #endregion

//        private Undo()
//        {

//        }
//        #region IActionPrototype Members

//        public IAction clone()
//        {
//            return new Undo();
//        }

//        public IAction clone(string arg)
//        {
//            return new Undo();
//        }

//        #endregion
//    }
//}
